// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import VueRouter from 'vue-router'
// import socketio from 'socket.io'

import Login from '@/components/login/login'
import Room  from '@/components/room/room'

Vue.use(VueRouter)

Vue.config.productionTip = false
// 奇怪了， 这里的 routes 是固定写法吗？ 写成  routers 就不能加载
const routes = [
  {path: '/', redirect: '/login'}, // 跳转到 /login
  {path: '/login', component: Login}, //
  {path: '/room', component: Room}
]
const router  = new VueRouter({
  mode: 'history',
  routes
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App }
})
